package com.syy.example.controller;

import com.syy.example.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class UserController {
    @ResponseBody
    @GetMapping("/getUser")
    public User getUser() {
        User user = new User();
        user.setName("syy");
        user.setAge(22);
        return user;
    }

    @ResponseBody
    @GetMapping("/getUser1")
    public String getUser1() {
        User user = new User();
        user.setName("syy");
        user.setAge(22);
        return user.toString();
    }
}
